package org.haifi.game.util;

import java.math.BigInteger;
import java.security.MessageDigest;

/**
 * 加密md5字符串
 * 
 * @author joycube2
 * 
 */
public class Md5Util {
	public static final String md5(String info) {
		try {
			MessageDigest messageDigest = MessageDigest.getInstance("MD5");
			messageDigest.reset();
			messageDigest.update(info.getBytes());
			return new BigInteger(1, messageDigest.digest()).toString(16);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
